import ExportJsonExcel from 'js-export-excel';

export const exportExcel = (columns, data, name, x) => {
  new ExportJsonExcel({
    fileName: name,
    datas: [
      {
        sheetData: data,
        sheetName:'data-mocker-sheet',
        sheetFilter: columns.map(c => c.key),
        sheetHeader: columns.map(c => c.title),
        columnWidths: columns.map(c => c.width / x * 100),
      },
    ],
  }).saveExcel();
};

